<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class REXML::DocType - rexml: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Parent
</div>

        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><a class="include" href="XMLTokens.html">REXML::XMLTokens</a>
  </ul>
</div>

        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li class="calls-super" ><a href="#method-c-new">::new</a>
    <li class="calls-super" ><a href="#method-i-add">#add</a>
    <li ><a href="#method-i-attribute_of">#attribute_of</a>
    <li ><a href="#method-i-attributes_of">#attributes_of</a>
    <li ><a href="#method-i-clone">#clone</a>
    <li ><a href="#method-i-context">#context</a>
    <li ><a href="#method-i-entity">#entity</a>
    <li ><a href="#method-i-node_type">#node_type</a>
    <li ><a href="#method-i-notation">#notation</a>
    <li ><a href="#method-i-notations">#notations</a>
    <li ><a href="#method-i-public">#public</a>
    <li ><a href="#method-i-system">#system</a>
    <li ><a href="#method-i-write">#write</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-REXML::DocType">
    <h1 id="class-REXML::DocType" class="class">
      class REXML::DocType
    </h1>

    <section class="description">
    
<p>Represents an XML DOCTYPE declaration; that is, the contents of &lt;!DOCTYPE … &gt;.  DOCTYPES can be used to declare the <a href="DTD.html"><code>DTD</code></a> of a document, as well as being used to declare entities used in the document.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="DEFAULT_ENTITIES">DEFAULT_ENTITIES
          <dd>
          <dt id="PUBLIC">PUBLIC
          <dd>
          <dt id="START">START
          <dd>
          <dt id="STOP">STOP
          <dd>
          <dt id="SYSTEM">SYSTEM
          <dd>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-entities" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">entities</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>name is the name of the doctype <a href="DocType.html#attribute-i-external_id"><code>external_id</code></a> is the referenced <a href="DTD.html"><code>DTD</code></a>, if given</p>
              </div>
            </div>
          <div id="attribute-i-external_id" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">external_id</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>name is the name of the doctype <a href="DocType.html#attribute-i-external_id"><code>external_id</code></a> is the referenced <a href="DTD.html"><code>DTD</code></a>, if given</p>
              </div>
            </div>
          <div id="attribute-i-name" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">name</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>name is the name of the doctype <a href="DocType.html#attribute-i-external_id"><code>external_id</code></a> is the referenced <a href="DTD.html"><code>DTD</code></a>, if given</p>
              </div>
            </div>
          <div id="attribute-i-namespaces" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">namespaces</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>name is the name of the doctype <a href="DocType.html#attribute-i-external_id"><code>external_id</code></a> is the referenced <a href="DTD.html"><code>DTD</code></a>, if given</p>
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">( first, parent=nil )</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Constructor</p>

<pre class="ruby"><span class="ruby-identifier">dt</span> = <span class="ruby-constant">DocType</span>.<span class="ruby-identifier">new</span>( <span class="ruby-string">&#39;foo&#39;</span>, <span class="ruby-string">&#39;-//I/Hate/External/IDs&#39;</span> )
<span class="ruby-comment"># &lt;!DOCTYPE foo &#39;-//I/Hate/External/IDs&#39;&gt;</span>
<span class="ruby-identifier">dt</span> = <span class="ruby-constant">DocType</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">doctype_to_clone</span> )
<span class="ruby-comment"># Incomplete.  Shallow clone of doctype</span>
</pre>

<p><code>Note</code> that the constructor:</p>

<pre class="ruby"><span class="ruby-constant">Doctype</span>.<span class="ruby-identifier">new</span>( <span class="ruby-constant">Source</span>.<span class="ruby-identifier">new</span>( <span class="ruby-string">&quot;&lt;!DOCTYPE foo &#39;bar&#39;&gt;&quot;</span> ) )
</pre>

<p>is <em>deprecated</em>.  Do not use it.  It will probably disappear.</p>
                                <div class="method-calls-super">
                                  Calls superclass method
                                  
                              </div>

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/doctype.rb, line 80</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>( <span class="ruby-identifier">first</span>, <span class="ruby-identifier">parent</span>=<span class="ruby-keyword">nil</span> )
  <span class="ruby-ivar">@entities</span> = <span class="ruby-constant">DEFAULT_ENTITIES</span>
  <span class="ruby-ivar">@long_name</span> = <span class="ruby-ivar">@uri</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">first</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">String</span>
    <span class="ruby-keyword">super</span>()
    <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">first</span>
    <span class="ruby-ivar">@external_id</span> = <span class="ruby-identifier">parent</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">first</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">DocType</span>
    <span class="ruby-keyword">super</span>( <span class="ruby-identifier">parent</span> )
    <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">first</span>.<span class="ruby-identifier">name</span>
    <span class="ruby-ivar">@external_id</span> = <span class="ruby-identifier">first</span>.<span class="ruby-identifier">external_id</span>
    <span class="ruby-ivar">@long_name</span> = <span class="ruby-identifier">first</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-value">:@long_name</span>)
    <span class="ruby-ivar">@uri</span> = <span class="ruby-identifier">first</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-value">:@uri</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">first</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Array</span>
    <span class="ruby-keyword">super</span>( <span class="ruby-identifier">parent</span> )
    <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">first</span>[<span class="ruby-value">0</span>]
    <span class="ruby-ivar">@external_id</span> = <span class="ruby-identifier">first</span>[<span class="ruby-value">1</span>]
    <span class="ruby-ivar">@long_name</span> = <span class="ruby-identifier">first</span>[<span class="ruby-value">2</span>]
    <span class="ruby-ivar">@uri</span> = <span class="ruby-identifier">first</span>[<span class="ruby-value">3</span>]
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">first</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Source</span>
    <span class="ruby-keyword">super</span>( <span class="ruby-identifier">parent</span> )
    <span class="ruby-identifier">parser</span> = <span class="ruby-constant">Parsers</span><span class="ruby-operator">::</span><span class="ruby-constant">BaseParser</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">first</span> )
    <span class="ruby-identifier">event</span> = <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">pull</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">event</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">:start_doctype</span>
      <span class="ruby-ivar">@name</span>, <span class="ruby-ivar">@external_id</span>, <span class="ruby-ivar">@long_name</span>, <span class="ruby-ivar">@uri</span>, = <span class="ruby-identifier">event</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">super</span>()
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-add" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add</span><span
                                class="method-args">(child)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              
                                <div class="method-calls-super">
                                  Calls superclass method
                                  
                              </div>

                              <div class="method-source-code" id="add-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/doctype.rb, line 185</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add</span> <span class="ruby-identifier">child</span>
  <span class="ruby-keyword">super</span>(<span class="ruby-identifier">child</span>)
  <span class="ruby-ivar">@entities</span> = <span class="ruby-constant">DEFAULT_ENTITIES</span>.<span class="ruby-identifier">clone</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@entities</span> <span class="ruby-operator">==</span> <span class="ruby-constant">DEFAULT_ENTITIES</span>
  <span class="ruby-ivar">@entities</span>[ <span class="ruby-identifier">child</span>.<span class="ruby-identifier">name</span> ] = <span class="ruby-identifier">child</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">child</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Entity</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-attribute_of" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">attribute_of</span><span
                                class="method-args">(element, attribute)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="attribute_of-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/doctype.rb, line 125</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">attribute_of</span> <span class="ruby-identifier">element</span>, <span class="ruby-identifier">attribute</span>
  <span class="ruby-identifier">att_decl</span> = <span class="ruby-identifier">find</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">child</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">child</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">AttlistDecl</span> <span class="ruby-keyword">and</span>
    <span class="ruby-identifier">child</span>.<span class="ruby-identifier">element_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">element</span> <span class="ruby-keyword">and</span>
    <span class="ruby-identifier">child</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">attribute</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">att_decl</span>
  <span class="ruby-identifier">att_decl</span>[<span class="ruby-identifier">attribute</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-attributes_of" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">attributes_of</span><span
                                class="method-args">(element)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="attributes_of-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/doctype.rb, line 115</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">attributes_of</span> <span class="ruby-identifier">element</span>
  <span class="ruby-identifier">rv</span> = []
  <span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">child</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">child</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>,<span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">rv</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Attribute</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">key</span>,<span class="ruby-identifier">val</span>)
    <span class="ruby-keyword">end</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">child</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">AttlistDecl</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">child</span>.<span class="ruby-identifier">element_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">element</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">rv</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-clone" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clone</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="clone-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/doctype.rb, line 135</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clone</span>
  <span class="ruby-constant">DocType</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-context" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">context</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="context-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/doctype.rb, line 173</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">context</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@parent</span>
    <span class="ruby-ivar">@parent</span>.<span class="ruby-identifier">context</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-entity" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">entity</span><span
                                class="method-args">( name )</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="entity-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/doctype.rb, line 181</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">entity</span>( <span class="ruby-identifier">name</span> )
  <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">unnormalized</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">name</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-node_type" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">node_type</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="node_type-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/doctype.rb, line 111</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">node_type</span>
  <span class="ruby-value">:doctype</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-notation" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">notation</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Retrieves a named notation. Only notations declared in the internal <a href="DTD.html"><code>DTD</code></a> subset can be retrieved.</p>

<p>Method contributed by Henrik Martensson</p>

                              <div class="method-source-code" id="notation-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/doctype.rb, line 229</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">notation</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">notations</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">notation_decl</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">notation_decl</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">name</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-notations" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">notations</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>This method returns a list of notations that have been declared in the <em>internal</em> <a href="DTD.html"><code>DTD</code></a> subset. Notations in the external <a href="DTD.html"><code>DTD</code></a> subset are not listed.</p>

<p>Method contributed by Henrik Martensson</p>

                              <div class="method-source-code" id="notations-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/doctype.rb, line 221</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">notations</span>
  <span class="ruby-identifier">children</span>().<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">node</span><span class="ruby-operator">|</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">NotationDecl</span>)}
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-public" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">public</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>This method retrieves the public identifier identifying the document’s <a href="DTD.html"><code>DTD</code></a>.</p>

<p>Method contributed by Henrik Martensson</p>

                              <div class="method-source-code" id="public-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/doctype.rb, line 195</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">public</span>
  <span class="ruby-keyword">case</span> <span class="ruby-ivar">@external_id</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;SYSTEM&quot;</span>
    <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;PUBLIC&quot;</span>
    <span class="ruby-ivar">@long_name</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-system" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">system</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>This method retrieves the system identifier identifying the document’s <a href="DTD.html"><code>DTD</code></a></p>

<p>Method contributed by Henrik Martensson</p>

                              <div class="method-source-code" id="system-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/doctype.rb, line 207</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">system</span>
  <span class="ruby-keyword">case</span> <span class="ruby-ivar">@external_id</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;SYSTEM&quot;</span>
    <span class="ruby-ivar">@long_name</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;PUBLIC&quot;</span>
    <span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">String</span>) <span class="ruby-operator">?</span> <span class="ruby-ivar">@uri</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-write" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">write</span><span
                                class="method-args">( output, indent=0, transitive=false, ie_hack=false )</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <dl class="rdoc-list note-list"><dt>output
<dd>
<p>Where to write the string</p>
</dd><dt>indent
<dd>
<p>An integer.  If -1, no indentation will be used; otherwise, the indentation will be this number of spaces, and children will be indented an additional amount.</p>
</dd><dt>transitive
<dd>
<p>Ignored</p>
</dd><dt>ie_hack
<dd>
<p>Ignored</p>
</dd></dl>

                              <div class="method-source-code" id="write-source">
            <pre><span class="ruby-comment"># File rexml-3.2.6/lib/rexml/doctype.rb, line 149</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">write</span>( <span class="ruby-identifier">output</span>, <span class="ruby-identifier">indent</span>=<span class="ruby-value">0</span>, <span class="ruby-identifier">transitive</span>=<span class="ruby-keyword">false</span>, <span class="ruby-identifier">ie_hack</span>=<span class="ruby-keyword">false</span> )
  <span class="ruby-identifier">f</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Formatters</span><span class="ruby-operator">::</span><span class="ruby-constant">Default</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-identifier">indent</span>( <span class="ruby-identifier">output</span>, <span class="ruby-identifier">indent</span> )
  <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">START</span>
  <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&#39; &#39;</span>
  <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@name</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@external_id</span>
    <span class="ruby-identifier">reference_writer</span> = <span class="ruby-constant">ReferenceWriter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@external_id</span>,
                                           <span class="ruby-ivar">@long_name</span>,
                                           <span class="ruby-ivar">@uri</span>,
                                           <span class="ruby-identifier">context</span>)
    <span class="ruby-identifier">reference_writer</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">output</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@children</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&#39; [&#39;</span>
    <span class="ruby-ivar">@children</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">child</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n&quot;</span>
      <span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>( <span class="ruby-identifier">child</span>, <span class="ruby-identifier">output</span> )
    }
    <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n]&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">STOP</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

